package com.dl.designmodel.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ProjectName: mcroservices
 * @Package: com.dl.designmodel.proxy
 * @ClassName: Cardinal
 * @Author: 86977
 * @Description: ${description}
 * @Date: 2021/6/30 17:33
 * @Version: 1.0
 */
public class Cardinal implements InvocationHandler {
  private  Object procyOne;

  public Cardinal(Object procyOne) {
    this.procyOne = procyOne;
  }

  @Override
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    method.invoke(procyOne,args);
    secondaryMain();
    return null;
  }

  private void secondaryMain(){
    System.out.println("黄雀吃螳螂,次要业务");
  }
}
